import axios from 'axios' // 调接口的工具

// 食物接口 类型
export interface FoodsListItem {
  category_id: string
  content: string
  glycemicIndex: string
  imgUrl: string
  level: number
  name: string
  quality: number
  checked?: boolean
}

export interface FoodsDataItem {
  name: string
  list: FoodsListItem[]
}

export interface FoodsRes {
  code: number
  msg: string
  data: FoodsDataItem[]
}

// 食物接口
export const getFoods = () => axios.get<FoodsRes>('http://121.89.213.194:3001/api/food')
